package com.gun.management.module.task.dal.dataobject.taskInfo;

import lombok.Data;

@Data
public class ShareContent {
    private String title;

    private String url;

    private String img;

    private String desc;

    public String toJsonString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (this.getTitle() != null) {
            sb.append("\"title\":\"" + this.getTitle() + "\",");
        }else {
                sb.append("\"title\": null, ");
        }
        if (this.getUrl() != null) {
            sb.append("\"url\":\"" + this.getUrl() + "\",");
        }else {
                sb.append("\"url\": null, ");
        }
        if (this.getImg() != null) {
            sb.append("\"img\":\"" + this.getImg() + "\",");
        } else {
                sb.append("\"img\": null, ");
        }
        if (this.getDesc() != null) {
            sb.append("\"desc\":\"" + this.getDesc() + "\"");
        } else {
           sb.append("\"desc\": null ");
        }

        sb.append("}");

        return sb.toString();

    }

}
